//
//  WelcomeViewController.m
//  HikingManagerRemake
//
//  Created by FENGYL on 2016/12/14.
//  Copyright © 2016年 FENGYL. All rights reserved.
//

#import "WelcomeViewController.h"
#import <BabyBluetooth.h>

@interface WelcomeViewController ()

@property (strong , nonatomic) BabyBluetooth * baby;

@end

@implementation WelcomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.layer.contents = (id)[UIImage imageNamed:@"hk_bg"].CGImage;
    
}

-(void)viewWillAppear:(BOOL)animated{
    
    [self.navigationController setNavigationBarHidden:YES];
    
}

-(void)viewWillDisappear:(BOOL)animated{
    
    [self.navigationController setNavigationBarHidden:NO];
    
}

#pragma mark 连接成功与否
-(void)bluetoothConnectSuccessOrFail{
    
    __block WelcomeViewController * safeSelf = self;
    
    //连接成功
    [self.baby setBlockOnConnected:^(CBCentralManager *central, CBPeripheral *peripheral) {
        
        [safeSelf.baby cancelAllPeripheralsConnection];
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
